package cate.game.role.res.guild.boss;

import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.mapping.Document;

@Document(collection = GuildBossRankSPO.COLLECTION)
@NoteClass("公会BOSS排行缓存")
public class GuildBossRankSPO {
    public static final String COLLECTION = "guild.boss.rank.cache";

    @Id
    @NoteField("文档键值")
    public String _id;
    @NoteField("公会UID")
    public String guildUid;
    @NoteField("挑战关卡数")
    public int combatNum;
    @NoteField("排行数据")
    public GuildBossRankPO rankPO;

    @Transient
    @NoteField("过期时间")
    public long expiredTime;

    /**
     * 构建唯一ID
     *
     * @param guildUid 公会UID
     * @param combatNum BOSS序号
     */
    public static String BUILD_KEY(String guildUid, int combatNum) {
        return guildUid + "_" + combatNum;
    }
}
